
/**
 * QQ客服联系
 * @author Jiangdw
 * @createDate 2015-10-30
 * @param $
 */
(function($){
    $.fn.qqservice = function(options){
		var _$this = $(this),
			_$opts = $.extend({}, $.fn.qqservice.defaults, options),
			_online = _$opts.online
			html = '',
			_qqs = _$opts.qqs,
			_$qqarray = _qqs.split(':');
		
		for(var i=0; i<_$qqarray.length; i++){
			html += '<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=' + _$qqarray[i] + '&site=qq&menu=yes" target="_blank">';
			
			if(_online[i] == 0){
				html += '<img border="0" width="21" height="21" src="/image/shopcart/qq-icon-offline.png" title="QQ离线，请留言" /></a>';
			} else {
				html += '<img border="0" width="21" height="21" src="/image/shopcart/qq-icon.png" title="点击这里给我发消息" /></a>';
			}
		}
		
		_$this.html(html);
		
		return this;
	};
	
	$.fn.qqservice.defaults = {
		qqs: '',//多个英文冒号隔开，如：598965300:583312637
		online: new Array()
	};
	
	
})(jQuery);